package umacis.implementation;
/**
 * 
 */

public class Handle
{
	public String name;
	

	public Handle(String actionName) throws ActionNotDefinedException {
		if (actionName == null) throw new ActionNotDefinedException();
		this.name = actionName;
		
	}

	public void execute() {
		
	}
	
	static public Handle getHandle(final Actions actions, int i) throws ActionIndexOutOfRangeException, ActionNotDefinedException {
		switch (i) {
		case -1: return new Handle(actions.action00(true)) { public void execute() { actions.action00(false); } };
		case 0 : return new Handle(actions.action00_Name()) { public void execute() { actions.action00_Body(); } }; 
		case 1 : return new Handle(actions.action01_Name()) { public void execute() { actions.action01_Body(); } }; 
		case 2 : return new Handle(actions.action02_Name()) { public void execute() { actions.action02_Body(); } }; 
		case 3 : return new Handle(actions.action03_Name()) { public void execute() { actions.action03_Body(); } }; 
		case 4 : return new Handle(actions.action04_Name()) { public void execute() { actions.action04_Body(); } }; 
		case 5 : return new Handle(actions.action05_Name()) { public void execute() { actions.action05_Body(); } }; 
		case 6 : return new Handle(actions.action06_Name()) { public void execute() { actions.action06_Body(); } }; 
		case 7 : return new Handle(actions.action07_Name()) { public void execute() { actions.action07_Body(); } }; 
		case 8 : return new Handle(actions.action08_Name()) { public void execute() { actions.action08_Body(); } }; 
		case 9 : return new Handle(actions.action09_Name()) { public void execute() { actions.action09_Body(); } }; 
		case 10 : return new Handle(actions.action10_Name()) { public void execute() { actions.action10_Body(); } }; 
		case 11 : return new Handle(actions.action11_Name()) { public void execute() { actions.action11_Body(); } }; 
		case 12 : return new Handle(actions.action12_Name()) { public void execute() { actions.action12_Body(); } }; 
		case 13 : return new Handle(actions.action13_Name()) { public void execute() { actions.action13_Body(); } }; 
		case 14 : return new Handle(actions.action14_Name()) { public void execute() { actions.action14_Body(); } }; 
		case 15 : return new Handle(actions.action15_Name()) { public void execute() { actions.action15_Body(); } }; 
		case 16 : return new Handle(actions.action16_Name()) { public void execute() { actions.action16_Body(); } }; 
		case 17 : return new Handle(actions.action17_Name()) { public void execute() { actions.action17_Body(); } }; 
		case 18 : return new Handle(actions.action18_Name()) { public void execute() { actions.action18_Body(); } }; 
		case 19 : return new Handle(actions.action19_Name()) { public void execute() { actions.action19_Body(); } }; 
		case 20 : return new Handle(actions.action20_Name()) { public void execute() { actions.action20_Body(); } }; 
		case 21 : return new Handle(actions.action21_Name()) { public void execute() { actions.action21_Body(); } }; 
		case 22 : return new Handle(actions.action22_Name()) { public void execute() { actions.action22_Body(); } }; 
				
		default : throw new ActionIndexOutOfRangeException();
		}
	}
}